Refactor Logger#773
Draft
stevenzeck wants to merge 1 commit into
Draft
Conversation
90f5291 to
024060e
Compare
bb72f66 to
2e72128
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the Shared logging subsystem for Swift 6 strict-concurrency compliance by moving the singleton Logger to an actor and updating the logging pipeline to avoid cross-thread shared-state violations.
Changes:
- Converted
Loggerfrom afinal classsingleton to anactor, and updatedReadiumEnableLogto configure it asynchronously. - Updated
LoggerType.logto acceptString?(instead ofAny?) and madeLoggerTypeSendable. - Updated
Loggabledefault implementations to convertAny?toString?and perform fire-and-forget logging viaTask.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Sources/Shared/Logger/Logger.swift | Converts the singleton logger to an actor; updates public configuration entrypoint and logger protocol for Swift 6 concurrency. |
| Sources/Shared/Logger/Loggable.swift | Wraps logging calls in Task and converts logged values to String? to match the new LoggerType API. |
| Sources/Shared/Logger/LoggerStub.swift | Updates the stub logger to the new LoggerType.log signature and prints the provided string message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2e72128 to
21ef771
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactored Logger to be Swift 6 compliant.
Public API Breaking Changes
LoggerType.logsignature changed: The value parameter type was changed fromAny?toString?.func log(level: SeverityLevel, value: Any?, file: String, line: Int)func log(level: SeverityLevel, value: String?, file: String, line: Int)Related to #758.